<template>
  <div class="getlist">
    <div v-for="(item, i) in list" :key="i" class="list" >
      <p class="name">{{ item.channel_info.name }}</p>
      <div>
        <div
          v-for="(ele, index) in item.list"
          :key="ele.teacher_id"
          class="eleList"
          v-show="ele.teacher_avatar"
          @click="goteacher(ele.teacher_id)"
        >
          <div class="left">
            <img :src="ele.teacher_avatar" alt="" />
          </div>
          <div class="right">
            <p>{{ ele.teacher_name }}</p>
            <p class="introduction">{{ ele.introduction }}</p>
          </div>
        </div>
      </div>
      <div
        class="cart-item"
        v-for="(v, id) in item.list"
        :key="id"
        v-show="v.title"
      >
        <div class="top">
          <p>{{ v.title }}</p>

          <p>共点击量</p>
        </div>
        <div class="center">
          <img :src="v.cover_img" alt="" />
        </div>
        <div class="bottom-item">
          <div class="bottom">
            <div
              v-for="(vv, ids) in v.teachers_list"
              :key="ids"
              class="bottom-list"
            >
              <p v-show="ids == 0" class="number">
                {{ vv.course_basis_id }}人报名
              </p>
            </div>
          </div>
          <div class="icon">
            <van-icon name="gold-coin" />
            <P> {{ v.price }}.00 </P>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
    props:['list'],
    methods: {
      goteacher(id){
        // 地址栏上可见
        this.$router.push({name:'teacherDetails',query:{id:id}})
        // 地址栏上不可见
        // this.$router.push({name:'teacherDetails',params:{id:id}})
      }
    },
}
</script>
<style lang="scss" scoped>
.getlist {
  width: 100%;
  padding: 0 10px;
  margin-top: 150px;
  .list {
    font-size: 22px;
    padding: 0 10px;
    .name {
      width: 100%;
      height: 32px;

      border-left: 5px solid red;
      padding-left: 10px;
      margin-bottom: 20px;
    }
    .eleList {
      width: 100%;
      background-color: white;
      margin-bottom: 10px;
      height: 100px;
      display: flex;
      .left {
        width: 18%;
        height: 100%;
        text-align: center;
        padding-top: 20px;
        img {
          width: 58px;
          height: 58px;
          border-radius: 50%;
        }
      }
      .right {
        padding-top: 20px;
        p {
          margin-bottom: 10px;
        }
        .introduction {
          color: #999999;
          font-size: 13px;
        }
      }
    }
    .cart-item {
      height: 215px;
      padding: 0 20px;
      background-color: white;
      margin-bottom: 10px;

      .top {
        height: 40%;
        p:nth-child(1) {
          font-size: 20px;
          margin: 10px 0;
        }
        p:nth-child(2) {
          font-size: 16px;
          color: #777777;
        }
      }
      .center {
        height: 40%;
        img {
          width: 58px;
          height: 58px;
          border-radius: 50%;
        }
      }
      .bottom-item {
        width: 100%;
        display: flex;
        .bottom {
          display: flex;
          justify-content: space-between;
          width: 100%;
          .number {
            font-size: 16px;
            color: #999999;
          }
          .bottom-list {
            width: 100%;
            display: flex;
            justify-content: space-between;
          }
        }
        .icon {
          display: flex;

          align-items: center;
          color: #ffa500;
          P {
            margin-left: 10px;
          }
        }
      }
    }
  }
}
</style>